import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
	state:{
		count:0,
		username:"",
		password:"",
		isLogin:false,
		loginType:""
	},
	getters:{
		showIsLogin(state){
			return state.isLogin;
		}
	},
	mutations:{
		changeLogin(state, data) {
			state.isLogin = data;
		},
		changeUsername(state, data) {
			state.username = data;
		},
		changePassword(state, data) {
			state.password = data;
		},
		changeLoginType(state,data){
			state.loginType = data;
		}
	},
	actions:{
		changeLogin({commit},data){
			commit('changeLogin',data);
		},
		changePassword(context,data){
			context.commit('changePassword',data);
		},
		changeUsername(context,data){
			context.commit('changeUsername',data);
		},
		changeLoginType(context,data){
			context.commit('changeLoginType',data);
		}
		
	}
})
export default store;